/*******************************************************************************
* Copyright (c) 2010, 2018 西安秦晔信息科技有限公司
* Licensed under the Apache License, Version 2.0 (the "License");
*    you may not use this file except in compliance with the License.
*    You may obtain a copy of the License at
*
*       http://www.apache.org/licenses/LICENSE-2.0
*
*    Unless required by applicable law or agreed to in writing, software
*    distributed under the License is distributed on an "AS IS" BASIS,
*    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*    See the License for the specific language governing permissions and
*    limitations under the License.
*******************************************************************************/
package com.qinyeit.serviceapp.entity;

import lombok.Builder;
import lombok.experimental.Tolerate;

import javax.persistence.*;
import java.util.List;
import java.util.Map;

/**
 * ClassName: BranchPurchaseOrderDetail <br/>
 * Function: 门店采购订单明细 <br/>
 * date: 2018-11-29 17:13:09 <br/>
 *
 * @author liuwenjin
 * @version  1.0
 * @since JDK 1.8
 */
@Builder
@Entity
@Table(name="branch_purchase_order_details")
public class BranchPurchaseOrderDetail extends MerchantGroupBaseEntity<Long> {

	private static final long serialVersionUID = 1L;

	// 订单id
	@ManyToOne
	@JoinColumn(name="order_id")
	private BranchPurchaseOrder order = null;

	// 物品规格id  单店系统的规格id
    @Column(name="spec_id")
	private Long specId = null;

	// 物品编号 
    @Column(name="no", length = 300)
	private String no = null;

	// 物品名称 
    @Column(name="name", length = 300)
	private String name = null;

	// 规格型号 
    @Column(name="material_spec", length = 300)
	private String materialSpec = null;

	// 库存单位 
    @Column(name="stock_unit", length = 300)
	private String stockUnit = null;

	// 采购规格 
    @Column(name="purchase_spec", length = 300)
	private String purchaseSpec = null;

	// 采购单位 
    @Column(name="purchase_unit", length = 300)
	private String purchaseUnit = null;

	// 采购数量 
    @Column(name="purchase_count",scale=2)
	private Double purchaseCount = null;

	// 采购单价 
    @Column(name="purchase_price",scale=2)
	private Double purchasePrice = null;

	// 发货数量 
    @Column(name="send_count",scale=2)
	private Double sendCount = null;

	// 发货单价 
    @Column(name="send_price",scale=2)
	private Double sendPrice = null;

	// 门店实收数量
    @Column(name="accept_count",scale=2)
	private Double acceptCount = null;

	// 门店实收单价
    @Column(name="accept_price",scale=2)
	private Double acceptPrice = null;

	// 总部备注 
    @Column(name="group_remark", length = 300)
	private String groupRemark = null;

	// 门店备注 
    @Column(name="branch_remark", length = 300)
	private String branchRemark = null;

	// 发货仓库id 
    @Column(name="stock_id")
	private Long stockId = null;

	// 发货仓库名称 
    @Column(name="stock_name", length = 300)
	private String stockName = null;

	// 物料uuid
    @Column(name="uuid", length = 300)
	private String uuid = null;



    //扣减仓库
    @Transient
	private List<Map<String,Object>> warehouses = null;



    @Tolerate
	public BranchPurchaseOrderDetail() {
		
	}
    @Tolerate
	public BranchPurchaseOrderDetail(Long id){
    	super.setId(id);
    }

	public BranchPurchaseOrder getOrder() {
		return order;
	}

	public void setOrder(BranchPurchaseOrder order) {
		this.order = order;
	}

	public String getUuid() {
		return uuid;
	}

	public void setUuid(String uuid) {
		this.uuid = uuid;
	}

	/**
	 * 获取物品规格id
	 */
	public Long getSpecId() {
		return this.specId;
	}

    /**
     * 设置物品规格id
     */
	public BranchPurchaseOrderDetail setSpecId(Long specId) {
		this.specId = specId;
		return this;
	}

	/**
	 * 获取物品编号
	 */
	public String getNo() {
		return this.no;
	}

    /**
     * 设置物品编号
     */
	public BranchPurchaseOrderDetail setNo(String no) {
		this.no = no;
		return this;
	}

	/**
	 * 获取物品名称
	 */
	public String getName() {
		return this.name;
	}

    /**
     * 设置物品名称
     */
	public BranchPurchaseOrderDetail setName(String name) {
		this.name = name;
		return this;
	}

	/**
	 * 获取规格型号
	 */
	public String getMaterialSpec() {
		return this.materialSpec;
	}

    /**
     * 设置规格型号
     */
	public BranchPurchaseOrderDetail setMaterialSpec(String materialSpec) {
		this.materialSpec = materialSpec;
		return this;
	}

	/**
	 * 获取库存单位
	 */
	public String getStockUnit() {
		return this.stockUnit;
	}

    /**
     * 设置库存单位
     */
	public BranchPurchaseOrderDetail setStockUnit(String stockUnit) {
		this.stockUnit = stockUnit;
		return this;
	}

	/**
	 * 获取采购规格
	 */
	public String getPurchaseSpec() {
		return this.purchaseSpec;
	}

    /**
     * 设置采购规格
     */
	public BranchPurchaseOrderDetail setPurchaseSpec(String purchaseSpec) {
		this.purchaseSpec = purchaseSpec;
		return this;
	}

	/**
	 * 获取采购单位
	 */
	public String getPurchaseUnit() {
		return this.purchaseUnit;
	}

    /**
     * 设置采购单位
     */
	public BranchPurchaseOrderDetail setPurchaseUnit(String purchaseUnit) {
		this.purchaseUnit = purchaseUnit;
		return this;
	}

	/**
	 * 获取采购数量
	 */
	public Double getPurchaseCount() {
		return this.purchaseCount;
	}

    /**
     * 设置采购数量
     */
	public BranchPurchaseOrderDetail setPurchaseCount(Double purchaseCount) {
		this.purchaseCount = purchaseCount;
		return this;
	}

	/**
	 * 获取采购单价
	 */
	public Double getPurchasePrice() {
		return this.purchasePrice;
	}

    /**
     * 设置采购单价
     */
	public BranchPurchaseOrderDetail setPurchasePrice(Double purchasePrice) {
		this.purchasePrice = purchasePrice;
		return this;
	}

	/**
	 * 获取发货数量
	 */
	public Double getSendCount() {
		return this.sendCount;
	}

    /**
     * 设置发货数量
     */
	public BranchPurchaseOrderDetail setSendCount(Double sendCount) {
		this.sendCount = sendCount;
		return this;
	}

	/**
	 * 获取发货单价
	 */
	public Double getSendPrice() {
		return this.sendPrice;
	}

    /**
     * 设置发货单价
     */
	public BranchPurchaseOrderDetail setSendPrice(Double sendPrice) {
		this.sendPrice = sendPrice;
		return this;
	}

	/**
	 * 获取实收数量
	 */
	public Double getAcceptCount() {
		return this.acceptCount;
	}

    /**
     * 设置实收数量
     */
	public BranchPurchaseOrderDetail setAcceptCount(Double acceptCount) {
		this.acceptCount = acceptCount;
		return this;
	}

	/**
	 * 获取实收单价
	 */
	public Double getAcceptPrice() {
		return this.acceptPrice;
	}

    /**
     * 设置实收单价
     */
	public BranchPurchaseOrderDetail setAcceptPrice(Double acceptPrice) {
		this.acceptPrice = acceptPrice;
		return this;
	}

	/**
	 * 获取总部备注
	 */
	public String getGroupRemark() {
		return this.groupRemark;
	}

    /**
     * 设置总部备注
     */
	public BranchPurchaseOrderDetail setGroupRemark(String groupRemark) {
		this.groupRemark = groupRemark;
		return this;
	}

	/**
	 * 获取门店备注
	 */
	public String getBranchRemark() {
		return this.branchRemark;
	}

    /**
     * 设置门店备注
     */
	public BranchPurchaseOrderDetail setBranchRemark(String branchRemark) {
		this.branchRemark = branchRemark;
		return this;
	}

	/**
	 * 获取发货仓库id
	 */
	public Long getStockId() {
		return this.stockId;
	}

    /**
     * 设置发货仓库id
     */
	public BranchPurchaseOrderDetail setStockId(Long stockId) {
		this.stockId = stockId;
		return this;
	}

	/**
	 * 获取发货仓库名称
	 */
	public String getStockName() {
		return this.stockName;
	}

    /**
     * 设置发货仓库名称
     */
	public BranchPurchaseOrderDetail setStockName(String stockName) {
		this.stockName = stockName;
		return this;
	}

	public List<Map<String, Object>> getWarehouses() {
		return warehouses;
	}

	public void setWarehouses(List<Map<String, Object>> warehouses) {
		this.warehouses = warehouses;
	}

}
